﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Macds.Core.Configuration;
using System.Collections.Generic;

namespace Macds.Test.Core.Configuration
{
    [TestClass]
    public class GenericElementCollectionTest
    {
        [TestMethod]
        public void Load_configuration_section()
        {
            var config = Mocks.ConnectionStringSection.Load();

            List<string> connections = new List<string>();
            foreach (CustomSettingElement database in config.Databases)
            {
                connections.Add(database.Key + database.Value);
            }

            Assert.AreEqual("Database1connection string #1", connections[0]);
            Assert.AreEqual("Database2connection string #2", connections[1]);
        }
    }
}
